<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
	<% String path=request.getContextPath(); String basePath=request.getScheme() + "://" + request.getServerName() + ":"
		+ request.getServerPort() + path + "/" ; %>

		<!DOCTYPE html>
		<html>

		<head>
			<base href="<%=basePath%>">

			<title>接口日志表</title>

			<meta http-equiv="pragma" content="no-cache">
			<meta http-equiv="cache-control" content="no-cache">
			<meta http-equiv="expires" content="0">
			<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
			<meta http-equiv="description" content="This is my page">
			<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

		</head>

		<body>
			<%@ include file="/WEB-INF/jsp/common/header.jsp" %>
				<%@ include file="/WEB-INF/jsp/common/loadDiv.jsp" %>

					<script type="text/javascript">
						$(function () {
							$('#startTime').datebox('setValue', getBeforeCurrentDate30Days());
							$('#endTime').datebox('setValue', getNowFormatDate());
							bindgrid();
						});
					</script>
					<script>
						function del(node) {
							$.ajax({
								type: "delete",
								url: 'sys/external/log/delete?extId=extId',
								//                dataType: "xml",				
								success: function (data) {
									$.messager.alert('消息', data);
									$('#add').window('close');
									bindgrid();
								},
								error: function (XMLHttpRequest, textStatus, errorThrown) {
									$.messager.alert('消息', errorThrown);
								}
							});
						}

						function save() {
							$('#fm').form('submit', {
								url: 'sys/external/log/save',
								iframe: false,
								onSubmit: function () {
									return $(this).form('validate');
								},
								success: function (result) {
									var result = eval('(' + result + ')');
									if (result.errorMsg) {
										$.messager.show({
											title: 'Error',
											msg: result.errorMsg
										});
									} else {
										$('#dlg').dialog('close'); // close the dialog
										$('#dg').datagrid('reload'); // reload the user data
									}
								}
							});
						}

						function editrow() {
							//编辑用户
							var row = $('#dg').datagrid('getSelected');
							if (row) {
								$('#add').window('open');
								$('#fm').form('load', row);

							} else {
								$.messager.alert('消息', '请选中一个用户');
							}
						}
					</script>
					<script>
						function selectList() {
							var startTime = $('#startTime').datebox('getValue')
							var endTime = $('#endTime').datebox('getValue')
							var dg = $('#dg');
							dg.datagrid('enableFilter');
							dg.datagrid('load', {
								startTime: startTime ? startTime : '',
								endTime: endTime ? endTime : ''
							});
						}
						function bindgrid() {
							var startTime = $('#startTime').datebox('getValue')
							var endTime = $('#endTime').datebox('getValue')
							$('#dg').datagrid({
								title: '日志列表',
								url: "sys/external/log/selectList",
								iconCls: 'icon-application',
								width: getWidth(0.98),
								queryParams: {
									startTime: startTime,
									endTime: endTime
								},
								height: 415,
								nowrap: true,
								filterDelay: 0,
								rownumbers: true,
								animate: false,
								collapsible: false,
								clientPaging: false,
								remoteFilter: true,
								singleSelect: true,
								pagination: true,
								remoteSort: true,
								columns: [[{
									field: 'extId',
									title: 'id',
									sortable: true,
									hidden: true,
									formatter: function (val, rec) {
										return val ? unescape(val) : '';
									}
								}, {
									field: 'extClass',
									title: '调用类',
									sortable: true,
									formatter: function (val, rec) {
										return val ? unescape(val) : '';
									}
								}, {
									field: 'extMethod',
									title: '调用方法',
									sortable: true,
									formatter: function (val, rec) {
										return val ? unescape(val) : '';
									}
								}, {
									field: 'extTime',
									title: '调用时长',
									sortable: true,
									formatter: function (val, rec) {
										return val ? unescape(val) : '';
									}
								}, {
									field: 'extSendBody',
									title: '发送内容',
									sortable: true,
									width: 300,
									formatter: function (val, rec) {
										return val ? unescape(val) : '';
									}
								}, {
									field: 'extReceiveBody',
									title: '接收内容',
									sortable: true,
									width: 300,
									formatter: function (val, rec) {
										return val ? unescape(val) : '';
									}
								}, {
									field: 'createTime',
									title: 'create_time',
									sortable: true,
									formatter: function (val, rec) {
										return val ? unescape(val) : '';
									}
								}, {
									field: 'createName',
									title: 'create_name',
									sortable: true,
									formatter: function (val, rec) {
										return val ? unescape(val) : '';
									}
								}, {
									field: 'createId',
									title: 'create_id',
									sortable: true,
									hidden: true,
									formatter: function (val, rec) {
										return val ? unescape(val) : '';
									}
								}, {
									field: 'updateId',
									title: 'update_id',
									sortable: true,
									hidden: true,
									formatter: function (val, rec) {
										return val ? unescape(val) : '';
									}
								}, {
									field: 'remark',
									title: 'remark',
									sortable: true,
									formatter: function (val, rec) {
										return val ? unescape(val) : '';
									}
								}]],
								toolbar: [],
								onLoadSuccess: function () {
								},
								onDblClickRow: function () {
									editrow();
								}
							});
							$('#dg').datagrid('enableFilter');
						}
					</script>
					<style scoped="scoped">
						.textbox {
							height: 20px;
							margin: 0;
							padding: 0 2px;
							box-sizing: content-box;
						}

						/*.table tr {
        height: 15px;
    }*/
					</style>
					<div style="margin: 5px 0px">
						<%-- 搜索框 --%>
							<label style="font-size: 12px;">创建时间：</label> <input class="easyui-datebox" name="startTime"
								id="startTime"
								data-options="required:true,showSeconds:false,formatter:myformatter,parser:myparser"
								value="" style="width: 150px"> <label style="font-size: 10px;">~</label> <input
								class="easyui-datebox" name="endTime" id="endTime"
								data-options="required:true,showSeconds:false,formatter:myformatter,parser:myparser"
								style="width: 150px" /> <a id="search" style="margin-left: 30px"
								href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-search'"
								onclick="selectList()">查询</a>
					</div>
					<table id="dg"></table>


					<div id="add" class="easyui-window" closed="true" modal="true" title="用户信息"
						style="width: 500px; height: 450px; padding: 10px 20px">
						<form id="fm" class="ssec-form">
							<table class="table">
								<tr>
									<td>
										<div class="ssec-label">id：</div>
									</td>
									<td>
										<div class="ssec-text normal">
											<input id="extId" name="extId" class="easyui-validatebox textbox"
												data-options="required:true" />
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<div class="ssec-label">调用外部系统描述：</div>
									</td>
									<td>
										<div class="ssec-text normal">
											<input id="extName" name="extName" class="easyui-validatebox textbox"
												data-options="required:true" />
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<div class="ssec-label">外部系统名称：</div>
									</td>
									<td>
										<div class="ssec-text normal">
											<input id="extSystemName" name="extSystemName"
												class="easyui-validatebox textbox" data-options="required:true" />
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<div class="ssec-label">调用类：</div>
									</td>
									<td>
										<div class="ssec-text normal">
											<input id="extClass" name="extClass" class="easyui-validatebox textbox"
												data-options="required:true" />
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<div class="ssec-label">调用方法：</div>
									</td>
									<td>
										<div class="ssec-text normal">
											<input id="extMethod" name="extMethod" class="easyui-validatebox textbox"
												data-options="required:true" />
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<div class="ssec-label">调用时长：</div>
									</td>
									<td>
										<div class="ssec-text normal">
											<input id="extTime" name="extTime" class="easyui-validatebox textbox"
												data-options="required:true" />
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<div class="ssec-label">发送内容：</div>
									</td>
									<td>
										<div class="ssec-text normal">
											<input id="extSendBody" name="extSendBody"
												class="easyui-validatebox textbox" data-options="required:true" />
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<div class="ssec-label">接收内容：</div>
									</td>
									<td>
										<div class="ssec-text normal">
											<input id="extReceiveBody" name="extReceiveBody"
												class="easyui-validatebox textbox" data-options="required:true" />
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<div class="ssec-label">create_time：</div>
									</td>
									<td>
										<div class="ssec-text normal">
											<input id="createTime" name="createTime" class="easyui-validatebox textbox"
												data-options="required:true" />
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<div class="ssec-label">create_name：</div>
									</td>
									<td>
										<div class="ssec-text normal">
											<input id="createName" name="createName" class="easyui-validatebox textbox"
												data-options="required:true" />
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<div class="ssec-label">create_id：</div>
									</td>
									<td>
										<div class="ssec-text normal">
											<input id="createId" name="createId" class="easyui-validatebox textbox"
												data-options="required:true" />
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<div class="ssec-label">update_id：</div>
									</td>
									<td>
										<div class="ssec-text normal">
											<input id="updateId" name="updateId" class="easyui-validatebox textbox"
												data-options="required:true" />
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<div class="ssec-label">update_name：</div>
									</td>
									<td>
										<div class="ssec-text normal">
											<input id="updateName" name="updateName" class="easyui-validatebox textbox"
												data-options="required:true" />
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<div class="ssec-label">update_time：</div>
									</td>
									<td>
										<div class="ssec-text normal">
											<input id="updateTime" name="updateTime" class="easyui-validatebox textbox"
												data-options="required:true" />
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<div class="ssec-label">del_flag：</div>
									</td>
									<td>
										<div class="ssec-text normal">
											<input id="delFlag" name="delFlag" class="easyui-validatebox textbox"
												data-options="required:true" />
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<div class="ssec-label">status：</div>
									</td>
									<td>
										<div class="ssec-text normal">
											<input id="status" name="status" class="easyui-validatebox textbox"
												data-options="required:true" />
										</div>
									</td>
								</tr>
								<!-- 				<tr> -->
								<!-- 					<td> -->
								<!-- 						<div class="ssec-label">remark：</div> -->
								<!-- 					</td> -->
								<!-- 					<td> -->
								<!-- 						<div class="ssec-text normal"> -->
								<!-- 							<input id="remark" name="remark" -->
								<!-- 								class="easyui-validatebox textbox" data-options="required:true" /> -->
								<!-- 						</div> -->
								<!-- 					</td> -->
								<!-- 				</tr> -->
								<!-- 				<tr> -->
								<!-- 					<td> -->
								<!-- 						<div class="ssec-label">sort：</div> -->
								<!-- 					</td> -->
								<!-- 					<td> -->
								<!-- 						<div class="ssec-text normal"> -->
								<!-- 							<input id="sort" name="sort" class="easyui-validatebox textbox" -->
								<!-- 								data-options="required:true" /> -->
								<!-- 						</div> -->
								<!-- 					</td> -->
								<!-- 				</tr> -->
							</table>
							<!-- 			<div style="padding: 5px; text-align: right;"> -->
							<!-- 				<a class="easyui-linkbutton" onclick="save();" iconcls="icon-save">保存</a> -->
							<!-- 			</div> -->
						</form>
					</div>
		</body>

		</html>